-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
josema/ch93710/fix-wrong-username-error #1687
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good approach! However, some things can be improved in the implementation:
- Filter only "not_found" CartoException in the
not_found
decorator. The other CartoExceptions should reach the user - Move the decorator to the context_manager
- Decorate only the carto-python request methods:
…nly NotFoundException subexception
Re-CR, please! Yes, the |
try: | ||
return func(*args, **kwargs) | ||
|
||
except CartoException as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simplify this to
except NotFoundException:
raise Exception('Resource not found')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't work :(
The exception is a CartoException
, created with a NotFoundException
as the only parameter, so we need to inspect the args
.
GH issue CARTOframes#1466
CH story ch93719